<?php

class admin_template_system_menu_group_edit extends admin_theme
{

	protected function center()
	{
		$menu_group = $this->get('menu_group');
		
		$ui_editor = bone::get_admin_ui('editor');
		$ui_editor->set_action('./?action=system.menu_group.edit_save');
		
		if($menu_group->class_name=='north' || $menu_group->class_name=='south')
		{
			echo '<script type="text/javascript" language="javascript">$(function(){ $("#class_name").attr("disabled", "disabled"); });</script>';
		}

		$ui_editor->set_fields(
            array(
				'type'=>'text',
			    'name'=>'name',
			    'label'=>'菜单组名',
				'value'=>$menu_group->name,
				'width'=>'200px',
            	'validate'=>array(
					'required'=>true,
					'max_length'=>60
				),
            	'message'=>array(
					'required'=>'请输入菜单组名',
					'max_length'=>'菜单组名最多可以输入{0}个字符'
				)
			),
			array(
				'type'=>'text',
			    'name'=>'class_name',
			    'label'=>'调用类名',
			    'value'=>$menu_group->class_name,
				'width'=>'120px',
				'validate'=>array(
					'required'=>true,
					'max_length'=>60
				),
            	'message'=>array(
					'required'=>'请输入调用类名',
					'max_length'=>'调用类名最多可以输入{0}个字符'
				)
			)		
		);
		
		$ui_editor->add_hidden('id', $menu_group->id);
		$ui_editor->add_hidden('return', $this->get('return'));
		
		$ui_editor->set_reset('重设');
		$ui_editor->set_back('返回', base64_decode($this->get('return')));
		$ui_editor->display();

	}	

}
?>